package config

import "awesomeProject/util"

type DataBaseConfig struct {
	UserName   string
	Password   string
	Host       string
	Port       string
	DataBase   string
	Collection string
}

type DbTool string

const (
	SKMysql   DbTool = "sk_mysql"
	SKMongoDb DbTool = "sk_mongodb"
)

var LocalDbTool DbTool

func LoadFile01(fileName, caseSelect string, request interface{}) {

	file_mysql := fileName + "_mysql.yml"

	file_mongodb := fileName + "_mongodb.yml"

	switch LocalDbTool {
	case SKMysql:
		{
			err := util.LoadConfig(file_mysql, caseSelect, &request)
			if err != nil {
				return
			}
		}
	case SKMongoDb:
		{
			err := util.LoadConfig(file_mongodb, caseSelect, &request)
			if err != nil {
				return
			}
		}
	default:
		{
			err := util.LoadConfig(file_mysql, caseSelect, &request)
			if err != nil {
				return
			}
		}

	}
}
